package main

import (
	"fmt"
)

func main() {
	the_array := []int{1, 2, 3, 4, 5}
	the_slice := the_array[:]
	debug_slice(the_slice, "[:] elements:")
	debug_slice(the_array[2:], "[2:] elements:")
	debug_slice(the_array[:4], "[:4] elements:")
	debug_slice(the_array[:4], "[:4] elements:")
	debug_slice(the_array[1:4], "[1:4] elements:")

	the_slice2 := make([]int, 5)
	debug_slice(the_slice2[0:5], "[:40] elements:")
}

func debug_slice(the_slice []int, msg string) {
	fmt.Println(msg)
	for i, item := range the_slice {
		fmt.Printf("the_slice[%d]=%d\n", i, item)
	}
}
